package pers.hl.module_main.mine

import android.view.LayoutInflater
import android.view.ViewGroup
import com.blankj.utilcode.util.ColorUtils
import com.chad.library.adapter.base.BaseBinderAdapter
import com.chad.library.adapter.base.binder.BaseItemBinder
import com.chad.library.adapter.base.binder.QuickViewBindingItemBinder
import pers.hl.common.utils.DrawableTintHelper
import pers.hl.common.utils.UiUtils
import pers.hl.module_main.R
import pers.hl.module_main.databinding.ItemRvMineMenuBinding

class MineAdapter() : BaseBinderAdapter() {

    class MineBinder : BaseItemBinder<MineMenu, QuickViewBindingItemBinder.BinderVBHolder<ItemRvMineMenuBinding>>(){
            override fun convert(
                holder: QuickViewBindingItemBinder.BinderVBHolder<ItemRvMineMenuBinding>,
                data: MineMenu
            ) {
                holder.viewBinding.apply {
                    tvMineMenu.text = data.menuName
                    ivMineMenu.setImageResource(data.icon)
//                    ivMineMenu.drawable.setTint(ColorUtils.getColor(R.color.recommend))
                }
            }

            override fun onCreateViewHolder(
                parent: ViewGroup,
                viewType: Int
            ): QuickViewBindingItemBinder.BinderVBHolder<ItemRvMineMenuBinding> {
                return QuickViewBindingItemBinder.BinderVBHolder(ItemRvMineMenuBinding.inflate(LayoutInflater.from(parent.context)))
            }
        }

}